home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1997 July
/
EnigmA AMIGA RUN 20 (1997)(G.R. Edizioni)(IT)[!][issue 1997-07 & 08][EAR-CD IV].iso
/
earcd
/
text
/
hyper
/
ixg07db.lha
/
ixg07db
/
docs
/
clock.rexx
next >
Wrap
OS/2 REXX Batch file
|
1997-03-22
|
2KB
|
114 lines
/* Clock.rexx 1.0 (3/97) */
/* Sample arexx client program for iX-Guide. */
/* This client displays the current system time */
if ~show('l', "rexxsupport.library") then
addlib('rexxsupport.library',0,-30,0)
OPTIONS RESULTS
/*
** Every rexx client receives pointer to iXG window as the last argument
** in form 'iXW=<address>'. That is the window the rexx client was launched
** from. You always have to pass this pointer to ADDCLIENT !
*/
PARSE ARG 'iXW=' windowPTR .
/*
** Port name of every rexx client should be in the following form:
** "IXCL_anythingyouwant_windowPTR"
*/
portname = "IXCL_clockCL_"
portname = INSERT(windowPTR,portname,LENGTH(portname))
/************************************************************************/
if show('p',portname) then exit /* we are already running */
ADDRESS IXGUIDE
/*
** Add this client to iX-Guide and pass received window pointer
*/
AddClient windowPTR
/************************************************************************/
fgcolor=2
bgcolor=1
call openport(portname)
setport portname MOUSE MISC
AllocRaster 1
rp=result
Refresh rp
OpenFont 'times.font' 24; f1 = result
SetFont rp f1
SetDrMd rp 1
SoftStyle rp 4
shutdown=0
do until shutdown
call UpdateTime()
call delay(25)
msg = getpkt(portname)
if msg ~= '0000 0000'x then do
cmd = getarg(msg)
if cmd='0000 0000'x then shutdown=1 /* pointer to window is NULL */
else if cmd=windowPTR then do /* this is message from our window */
cmd = getarg(msg,1)
if cmd='MOUSE' then do
a1=getarg(msg,2)
if a1=1 then do
if fgcolor=1 then fgcolor=2
else fgcolor=1
if bgcolor=1 then bgcolor=2
else bgcolor=1
end
end
if cmd='MISC' then do
a4=getarg(msg,2)
if a4='QUIT' then shutdown=1
if a4='CLOSEWIN' then shutdown=1
if a4='LINKOK' then do
a5=getarg(msg,3)
a6=getarg(msg,4)
if (a5='clockdemo.ixml') & (a6='main') then shutdown=0
else shutdown=1
end
end
end
call reply(msg,0)
end
end
/*
** Clean up
*/
CloseFont f1
FreeRaster rp
RemClient
call closeport(portname)
exit
UpdateTime:
SetABPen rp fgcolor bgcolor
Move rp 5 20
timestr = Time()
Text rp timestr
return 0